#include"Library.h"
void functAddBook(LibList* libList)
{
	//先找到链表的尾端，尾端进行增添
	bookNode* cur = libList->head;
	if (cur == NULL)
	{
		printf("链表头为空\n");
		return;
	}
	while (cur->next)
	{
		cur = cur->next;
	}
	int addNum=0;
	printf("请问你要增添几本书?\n");
	scanf("%d", &addNum);
	for(int i=1;i<=addNum;i++)
	{
		printf("正在添加第%d本书:\n", i);
		bookNode* add = new bookNode();
		add->next = NULL;
		printf("请输入增添书籍的ISBN码:\n");
		scanf("%s", add->data.ISBN);
		printf("请输入增添书籍的名字:\n");
		scanf("%s", add->data.name);
		printf("请输入增添书籍的作者:\n");
		scanf("%s", add->data.auth);
		printf("请输入增添书籍的价格:\n");
		scanf("%f", &add->data.price);
		printf("请输入增添书籍的库存容量:\n");
		scanf("%d", &add->data.inventory);
		cur->next = add;
		cur = add;
		libList->bookNum++;
	}
}
